package sudroid.json;

import java.util.HashMap;

public class XMLTokener extends JSONTokener
{
  public static final HashMap entity = new HashMap(8);

  static
  {
    HashMap localHashMap1 = entity;
    Character localCharacter1 = XML.AMP;
    Object localObject1 = localHashMap1.put("amp", localCharacter1);
    HashMap localHashMap2 = entity;
    Character localCharacter2 = XML.APOS;
    Object localObject2 = localHashMap2.put("apos", localCharacter2);
    HashMap localHashMap3 = entity;
    Character localCharacter3 = XML.GT;
    Object localObject3 = localHashMap3.put("gt", localCharacter3);
    HashMap localHashMap4 = entity;
    Character localCharacter4 = XML.LT;
    Object localObject4 = localHashMap4.put("lt", localCharacter4);
    HashMap localHashMap5 = entity;
    Character localCharacter5 = XML.QUOT;
    Object localObject5 = localHashMap5.put("quot", localCharacter5);
  }

  public XMLTokener(String paramString)
  {
    super(paramString);
  }

  public String nextCDATA()
    throws JSONException
  {
    StringBuffer localStringBuffer1 = new StringBuffer();
    int i;
    int k;
    do
    {
      int j;
      do
      {
        do
        {
          char c = next();
          if (c == 0)
            throw syntaxError("Unclosed CDATA");
          StringBuffer localStringBuffer2 = localStringBuffer1.append(c);
          i = localStringBuffer1.length() - 3;
        }
        while ((i < 0) || (localStringBuffer1.charAt(i) != 93));
        j = i + 1;
      }
      while (localStringBuffer1.charAt(j) != 93);
      k = i + 2;
    }
    while (localStringBuffer1.charAt(k) != 62);
    localStringBuffer1.setLength(i);
    return localStringBuffer1.toString();
  }

  public Object nextContent()
    throws JSONException
  {
    int i;
    do
      i = next();
    while (Character.isWhitespace(i));
    Object localObject1;
    if (i == 0)
      localObject1 = null;
    StringBuffer localStringBuffer1;
    while (true)
    {
      return localObject1;
      if (i == 60)
      {
        localObject1 = XML.LT;
        continue;
      }
      localStringBuffer1 = new StringBuffer();
      if ((i != 60) && (i != 0))
        break;
      back();
      localObject1 = localStringBuffer1.toString().trim();
    }
    if (i == 38)
    {
      Object localObject2 = nextEntity(i);
      StringBuffer localStringBuffer2 = localStringBuffer1.append(localObject2);
    }
    while (true)
    {
      char c = next();
      break;
      StringBuffer localStringBuffer3 = localStringBuffer1.append(c);
    }
  }

  public Object nextEntity(char paramChar)
    throws JSONException
  {
    StringBuffer localStringBuffer1 = new StringBuffer();
    int i;
    while (true)
    {
      i = next();
      if ((!Character.isLetterOrDigit(i)) && (i != 35))
        break;
      char c = Character.toLowerCase(i);
      StringBuffer localStringBuffer2 = localStringBuffer1.append(c);
    }
    String str1;
    Object localObject1;
    if (i == 59)
    {
      str1 = localStringBuffer1.toString();
      localObject1 = entity.get(str1);
      if (localObject1 == null)
        break label102;
    }
    label102: String str3;
    for (Object localObject2 = localObject1; ; localObject2 = str3 + str1 + ";")
    {
      return localObject2;
      String str2 = "Missing ';' in XML entity: &" + localStringBuffer1;
      throw syntaxError(str2);
      str3 = String.valueOf(paramChar);
    }
  }

  public Object nextMeta()
    throws JSONException
  {
    char c1;
    do
      c1 = next();
    while (Character.isWhitespace(c1));
    Object localObject;
    switch (c1)
    {
    default:
      c1 = next();
      if (!Character.isWhitespace(c1))
        break;
      localObject = Boolean.TRUE;
    case '\000':
    case '<':
    case '>':
    case '/':
    case '=':
    case '!':
    case '?':
    case '"':
    case '\'':
    }
    while (true)
    {
      return localObject;
      throw syntaxError("Misshaped meta tag");
      localObject = XML.LT;
      continue;
      localObject = XML.GT;
      continue;
      localObject = XML.SLASH;
      continue;
      localObject = XML.EQ;
      continue;
      localObject = XML.BANG;
      continue;
      localObject = XML.QUEST;
      continue;
      char c2 = c1;
      do
      {
        c1 = next();
        if (c1 != 0)
          continue;
        throw syntaxError("Unterminated string");
      }
      while (c1 != c2);
      localObject = Boolean.TRUE;
      continue;
      switch (c1)
      {
      default:
        break;
      case '\000':
      case '!':
      case '"':
      case '\'':
      case '/':
      case '<':
      case '=':
      case '>':
      case '?':
        back();
        localObject = Boolean.TRUE;
      }
    }
  }

  public Object nextToken()
    throws JSONException
  {
    int i;
    do
      i = next();
    while (Character.isWhitespace(i));
    StringBuffer localStringBuffer1;
    Object localObject1;
    switch (i)
    {
    default:
      localStringBuffer1 = new StringBuffer();
      StringBuffer localStringBuffer2 = localStringBuffer1.append(i);
      i = next();
      if (!Character.isWhitespace(i))
        break;
      localObject1 = localStringBuffer1.toString();
    case 0:
    case 60:
    case 62:
    case 47:
    case 61:
    case 33:
    case 63:
    case 34:
    case 39:
    }
    while (true)
    {
      return localObject1;
      throw syntaxError("Misshaped element");
      throw syntaxError("Misplaced '<'");
      localObject1 = XML.GT;
      continue;
      localObject1 = XML.SLASH;
      continue;
      localObject1 = XML.EQ;
      continue;
      localObject1 = XML.BANG;
      continue;
      localObject1 = XML.QUEST;
      continue;
      int j = i;
      localStringBuffer1 = new StringBuffer();
      while (true)
      {
        i = next();
        if (i == 0)
          throw syntaxError("Unterminated string");
        if (i == j)
        {
          localObject1 = localStringBuffer1.toString();
          break;
        }
        if (i == 38)
        {
          Object localObject2 = nextEntity(i);
          StringBuffer localStringBuffer3 = localStringBuffer1.append(localObject2);
          continue;
        }
        StringBuffer localStringBuffer4 = localStringBuffer1.append(i);
      }
      switch (i)
      {
      default:
        break;
      case 0:
        localObject1 = localStringBuffer1.toString();
        break;
      case 33:
      case 47:
      case 61:
      case 62:
      case 63:
      case 91:
      case 93:
        back();
        localObject1 = localStringBuffer1.toString();
      case 34:
      case 39:
      case 60:
      }
    }
    throw syntaxError("Bad character in a name");
  }

  public boolean skipPast(String paramString)
    throws JSONException
  {
    int i = 0;
    int j = paramString.length();
    char[] arrayOfChar = new char[j];
    int k = 0;
    if (k >= j);
    while (true)
    {
      int m = i;
      int n = 1;
      k = 0;
      label30: label36: int i1;
      if (k >= j)
      {
        if (n == 0)
          break label135;
        i1 = 1;
      }
      int i2;
      while (true)
      {
        return i1;
        i2 = next();
        if (i2 == 0)
        {
          i1 = 0;
          continue;
        }
        arrayOfChar[k] = i2;
        k += 1;
        break;
        int i3 = arrayOfChar[m];
        int i4 = paramString.charAt(k);
        if (i3 != i4)
        {
          n = 0;
          break label36;
        }
        m += 1;
        if (m >= j)
          m -= j;
        k += 1;
        break label30;
        label135: i2 = next();
        if (i2 != 0)
          break label152;
        i1 = 0;
      }
      label152: arrayOfChar[i] = i2;
      i += 1;
      if (i < j)
        continue;
      i -= j;
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.json.XMLTokener
 * JD-Core Version:    0.6.0
 */